package com.doubleview.demo
/**
 * @author huchengchao <huchengchao@kuaishou.com>
 * Created on 2021-11-20
 */
boolean b = true
String message = 'Hello from Groovy'
// Serialize data into a file
file = new File("")

file.withDataOutputStream { out ->
    out.writeBoolean(b)
    out.writeUTF(message)
}
// ...
// Then read it back
file.withDataInputStream { input ->
    assert input.readBoolean() == b
    assert input.readUTF() == message
}
